<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html>

<html>

	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>管理后台</title>
		<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
		<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
		<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
		<script>
		$(function(){
			$('#tt').tree({
				checkbox:true,
				//onlyLeafCheck:true,
			    url:'auth/space/getAllUrlsJson'
			});
			$('#check').click(function(){
				var checkedUrls = [];
				var checked = $('#tt').tree('getChecked');
				for(i=0;i<checked.length;i++){
				if($('#tt').tree('isLeaf',checked[i].target))
					checkedUrls.push(checked[i].id);
					//alert(checked[i].text);
				}
				alert(checkedUrls.join(','));
			});
		});
		
		</script>
	</head>
<body>
<ul id="tt"></ul>
<button id="check">选中</button>
</body>